<?php get_header(); ?>
<?php global $options; foreach ($options as $value) { if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } } ?>

<?php if (have_posts()) : ?>

				<?php while (have_posts()) : the_post(); ?>		
      		<div class="postContainer">
      				<div class="post">
      					<div class="entry">
      			    <h3 style="margin:0;"><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3>
      			    <p class="meta" style="margin-bottom:15px;"><?php the_time('j \d\e F \d\e Y'); ?>&nbsp;&nbsp;|&nbsp;&nbsp;<?php comments_popup_link('Deixe um Coment&aacute;rio', '1 Coment&aacute;rio', '% Coment&aacute;rios', 'comments-link', 'Os coment&aacute;riosComments est&atilde;o desabilitados'); ?></p>
      					<?php the_content(); ?>
      					<p><?php edit_post_link('Editar', '', ' | '); ?><?php the_tags('<b>Tags: </b>', ', ', '<br />'); ?> </p>
      					
      				</div>
      			</div>
      		</div>
				<?php endwhile; ?> 
<div class="navigation">
					<div class="alignleft"><?php next_posts_link(__('&laquo; Posts Mais Antigos', 'kubrick')) ?></div>
					<div class="alignright"><?php previous_posts_link(__('Posts Mais Novos &raquo;', 'kubrick')) ?></div>
				</div>				

<?php
				// include('wp-pagenavi.php');
				if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
				?>
				
	<?php else : 
	
	if ( is_category() ) { // If this is a category archive
			printf("<h2>Desculpe, mas n&atilde;o h&aacute; nenhum post nesta categoria.</h2>", single_cat_title('',false));
		} else if ( is_date() ) { // If this is a date archive
			echo("<h2>Desculpe, mas n&atilde;o h&aacute; nenhum post nesta data.</h2>");
		} else if ( is_author() ) { // If this is a category archive
			$userdata = get_userdatabylogin(get_query_var('author_name'));
			printf("<h2>Desculpe, mas n&atilde;o h&aacute; nenhum post escrito por %s.</h2>", $userdata->display_name);
		} else {
			echo("<h2>Nenhum post encontrado.</h2>");
		}
		
		include (TEMPLATEPATH . '/searchform.php');
		
	endif; ?>
		
<?php if($useGeneralSidebar == "No") { get_sidebar('blog'); } else { get_sidebar(); } ?>
<?php get_footer(); ?>